<table id="embassies" class="admingrid">
</table>
<div id="embassies_pager"></div>
<br>
<button onclick="addEmbassy()">Add businesspartner</button>
<button onclick="removeembassies()">Remove selected embassies</button>

<script>
grids.embassies = {
    url : generateServiceUrl({
        admin : true,
        service : "getembassies",
        page : "group_members"
    }),
    colNames : [
        "Partner name",
        "Contact person",
        "Email"
    ],
    colModel : [
        { name : "embassy_name", index : "embassy_name",  width : 300 },
        { name : "contact_person",  index : "contact_person",   width : 170 },
        { name : "email",           index : "email",            width : 150 }
    ],
    caption : "Embassy list",
    multiselect : true,
    multiboxonly : true,
    height : 320
};

function addEmbassy() {
    openAdminPopup("group_members", "add", {
        title : "Adding Embassy"
    }, {
        membertype : "embassies"
    });
}

function removeembassies() {
    if (confirm("Are you sure to want to delete selected embassies?")) {
        var selectedItems = getSelectedRows("embassies");
        callAdminService("group_members", "delete", {
            ids : selectedItems
        }, {
            success : function(result) {
                refreshGrid("embassies");
            }
        });
    }
}

</script>
